#-*- coding:utf-8 -*-
'''
    例子,供参考.
'''
import tornado.httpclient

class websiteWordStatistics:
    def fetch(self,url):
        print url
        http_header = {'User-Agent': 'Chrome'}
        http_request = tornado.httpclient.HTTPRequest(url=url, headers=http_header, connect_timeout=20, request_timeout=600)

        http_client = tornado.httpclient.HTTPClient()
        http_response = http_client.fetch(http_request)

        print http_response.code


if __name__ == '__main__':
    print("hello,")
    wws = websiteWordStatistics()
    wws.fetch('http://www.baidu.com')



